<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>alipaydemo</title>
<link rel="stylesheet" href="css/result.css" type="text/css"></link>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<style type="text/css">
.submit_order_info {
	width: 120px;
	height: 30px;
	border: 1px solid #f2f2f2;
	text-align: center;
	line-height: 30px;
	cursor: pointer;
}
</style>
</head>

<body>
	<c:if test="${empty currentUser }">
		<jsp:forward page="jsp/login.jsp"></jsp:forward>
	</c:if>

	<div class="main_div">
		<div class="margin_to_50"></div>

		<div style="border: 1px solid #dedede">
			<div class="margin_to_20">
				<h1>收获地址信息</h1>
				<div class="margin_to_20" style="height: 30px;background-color: #f2f2f2;margin-left: 30px;"></div>
			</div>

			<div class="margin_to_20">
				<h1>发票信息</h1>
				<div class="margin_to_20" style="height: 30px;background-color: #f2f2f2;margin-left: 30px;"></div>
			</div>

			<div class="margin_to_20">
				<h1>订单确认信息</h1>
				<div class="margin_to_20" style="background-color: #f2f2f2;margin-left: 30px;">
					<table class="table table-bordered">
						<thead>
							<tr>
								<th>订单号</th>
								<th>商品ID</th>
								<th>商品名称</th>
								<th>商品图片</th>
								<th>商品价格</th>
								<th>商品数量</th>
								<th>商品总价</th>
							</tr>
						</thead>

						<tbody>
							<c:forEach items="${orderDetailMap }" var="orderItem">
								<input type="hidden" var="${orderItem.orderNo }" class="orderNo" />
								<tr>
									<td>${orderItem.orderNo }</td>
									<td>${orderItem.productId }</td>
									<td>${orderItem.productName }</td>
									<td>${orderItem.productImage }</td>
									<td>${orderItem.currentUnitPrice }</td>
									<td>${orderItem.quantity }</td>
									<td>${orderItem.totalPrice }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>

		</div>
		<div class="float_right">
			<div class="margin_to_20  submit_order_info">提交订单</div>
		</div>
	</div>

	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<script type="text/javascript">
		$(function() {
			$(".submit_order_info").on("click", function() {
				var orderNo = $(".orderNo").attr("var");
				console.log(orderNo);
				location.href = "order/pay?orderId=" + orderNo;
			});
		});
	</script>
</body>
</html>
